<?php

namespace app\systems\logic;

use app\admin\logic\BasicLogic;
use app\admin\logic\TestLogic;
use app\api\logic\TrackLogic;
use app\common\service\JinyiApiService;
use app\common\service\TiktokPackageApiService;
use app\order\logic\OrderDocumentServiceLogic;
use app\advertisement\logic\ApiAdvaccountLogic;
use app\order\logic\OrderServiceLogic;
use app\order\logic\OrderShipServiceLogic;
use app\common\service\CommonSystemImportInfoDetailService;
use app\common\service\CommonSystemImportService;
use app\order\logic\OrderWhServiceLogic;
use app\order\logic\OrderWebHookLogic;
use app\customer\logic\TikMessageLogic;
use app\order\logic\OrderLogic;
use app\checkbill\logic\BillLogic;
use app\checkbill\logic\BillQcLogic;
use app\customer\logic\BatchMessageLogic;
use app\shop\logic\ShopLogic;

class MqTaskServiceLogic extends BasicLogic
{
    public function __call($name, $arguments)
    {
        p($name);
        p($arguments);
    }


    /**
     * sku     跟卖异常数据获取队列
     * @author luckyXiong
     * @date   2024-03-13
     */
    public function sale_center_follow_exception_link_fun($message)
    {
        return (new TestLogic())->follow_exception_link_consumer($message);
    }

    /**
     * @desc  发货队列-执行方法
     * @date  2024/3/18 0021
     * @param $message
     * @return null
     * @author ligang
     */
    public function order_shipping_queue_fun($message)
    {
        return (new OrderShipServiceLogic())->orderShippingQueueConsume($message);
    }

    /**
     * 系统导入详情队列
     * @param $message
     * @return mixed
     * @author: luckyXiong
     * @Date: 2024/3/21
     */
    public function sale_center_system_import_task_detail($message)
    {
        return CommonSystemImportInfoDetailService::staticModel()->system_import_task_detail($message);
    }


    /**
     * @Notes:队列：系统导入消费队列sale_center_system_import_task
     * @Author: xx
     * @Date: 2024/3/21
     * @Time: 17:19
     * @param $message
     * @return bool|mixed
     */
    public function sale_center_system_import_task($message)
    {
        return CommonSystemImportService::staticModel()->consume_center_system_import_queue($message);
    }
    
     /**
     * 网红订单-发货队列-执行方法
     * @desc  网红订单-发货队列-执行方法
     * @date  2024/3/20 0021
     * @param $message
     * @return null
     * @author ligang
     */
    public function wh_order_shipping_queue_fun($message)
    {
        return (new OrderWhServiceLogic())->orderWhShippingQueueConsume($message);
    }

    /**
     * @desc  创建面单-执行方法
     * @date  2024/3/20 0021
     * @param $message
     * @return null
     * @author ligang
     */
    public function tik_order_shipping_document_queue_fun($message)
    {
        return (new OrderDocumentServiceLogic())->orderShippingDocumentsQueueConsume($message);
    }


    /**
     * @desc     TIK买面单生成PDF失败处理
     * @atuthor  luckyXiong
     * @date     2024-05-11
     */
    public function sale_center_order_document_change_queue_fun($message)
    {
        return  (new TiktokPackageApiService())->downChangeDocUrl($message);
    }



    /**
     * 获取tiktok店铺列表数据列表队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024/4/09
     */
    public function tik_order_list_queue_fun($message)
    {
        return (new OrderLogic())->getOrderListConsumer($message);
    }



    /**
     * 获取tiktok店铺列表数据列表队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024/4/09
     */
    public function tik_order_info_update_queue_fun($message)
    {
        return (new OrderLogic())->getOrderInfoConsumer($message);
    }


    /**
     * 获取tiktok店铺列表数据列表队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024/4/09
     */
    public function jinyi_tracking_number_update_queue_fun($message)
    {
        return (new JinyiApiService())->tracking_number_update_consumer($message);
    }



    /**
     * 获取tiktok广告系列广告花费
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024/4/09
     */
    public function tiktok_integrated_list_queue_fun($message)
    {
        return (new ApiAdvaccountLogic())->tiktok_integrated_list($message);
    }

    /**
     * 每天转点之后更新所有广告账户当天的数据
     * @param   $message
     * @return  mixed
     * @author: zhangheng
     * @Date:   2024/4/09
     */
    public function tiktok_campaign_list_queue_fun($message)
    {
        return (new ApiAdvaccountLogic())->tiktok_campaign_list($message);
    }

    /**
     * 临时任务
     * @param   $message
     * @return  mixed
     * @author: zhangheng
     * @Date:   2024/4/09
     */
    public function tiktok_temporary_tasks_queue_fun($message)
    {
        return (new ApiAdvaccountLogic())->temporary_tasks($message);
    }


    /**
     * 临时任务  顺丰月度对账
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/4/22
     */
    public function tik_order_month_sf_queue_fun($message)
    {
        return (new BillLogic())->importSFComsumer($message);
    }



    /**
     * 临时任务  前程无忧月度对账
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/4/22
     */
    public function tiktok_qc_month_order_queue_fun($message)
    {
        return (new BillQcLogic())->checkQcComsumer($message);
    }


    /**
     * 临时任务  获取shippingfee
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/4/26
     */
    public function tiktok_fee_order_queue_fun($message)
    {
        return (new OrderLogic())->shipping_fee_consumer($message);
    }



    /**
     * 临时任务  更新拉取订单数据
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/4/27
     */
    public function tik_order_info_operate_queue_fun($message)
    {
        return (new OrderLogic())->operate_order_consumer($message);
    }


    /**
     * @desc    私信群发消费方法
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/5/24
     */
    public function tik_private_send_message_queue_fun($message)
    {
        return (new BatchMessageLogic())->private_send_message_consumer($message);
    }



    /**
     * 物流单号更新队列
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/5/16
     */
    public function tik_order_update_track_number_queue_fun($message)
    {
        return (new OrderServiceLogic())->updateUserName($message);
    }


    /**
     * @desc    拉取会话消息队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-05-21
     */
    public function tik_conversation_message_queue_fun($message)
    {
        return (new TestLogic())->get_conversations_mess($message);
    }


    /**
     * @desc    批量发送会话消息
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-05-21
     */
    public function tik_send_conversation_message_queue_fun($message)
    {
        return (new TikMessageLogic())->send_batch_messages($message);
    }

    /**
     * @desc    批量更新token
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-05-27
     */
    public function tiktok_shop_token_update_queue_fun($message)
    {
        return (new ShopLogic())->updateShopInfo($message);
    }



    /**
     * @desc    获取所有店铺会话
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-05-28
     */
    public function tiktok_shop_conversations_queue_fun($message)
    {
        return (new TestLogic())->get_conversations_list($message);
    }


    /**
     * @desc    获取会话订单SKU
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-05-28
     */
    public function tiktok_order_sku_info_queue_fun($message)
    {
        return (new TestLogic())->get_sku_info($message);
    }


    /**
     * @desc    获取会话订单SKU
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-05-29
     */
    public function tiktok_order_webhook_track_queue_fun($message)
    {
        return (new TrackLogic())->track_register($message);
    }


    /**
     * @desc    客服会话消息
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-05-31
     */
    public function tiktok_order_conversations_read_queue_fun($message)
    {
        return (new TrackLogic())->conversations_read_queue($message);
    }



    /**
     * @desc    每月更新订单状态
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-06-06
     */
    public function tik_order_update_month_status_queue_fun($message)
    {
        return (new TestLogic())->update_status_consumer($message);
    }



    /**
     * @desc    二次获取PDF文件
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-07-04
     */
    public function tik_order_doc_pdf_queue_fun($message)
    {
        return  (new TiktokPackageApiService())->downDocUrl($message);
    }


    /**
     * @desc    shopify历史数据清洗
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-07-10
     */
    public function tik_order_shopify_change_queue_fun($message)
    {
        return  (new TestLogic())->shopify_change($message);
    }


}
